import React from 'react'
import { Swiper, Button } from 'antd-mobile'
import './index.scss'
import { useNavigate } from 'react-router'
import { useLocation } from 'umi'
export default function index() {
  const navigate = useNavigate()
  const localtion = useLocation()
  const path = localtion.state.path
  console.log(localtion);

  return (
    <>
      <div className='startPage' >
        <div className='swiperpage'>

        </div>
        <Swiper autoplay loop>
          <Swiper.Item>
            <img src="https://img2.baidu.com/it/u=2719162590,1949620254&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=705" />
          </Swiper.Item>
          <Swiper.Item>
            <img src="https://img1.baidu.com/it/u=787182755,2317248557&fm=253&fmt=auto&app=120&f=JPEG?w=500&h=782" />
          </Swiper.Item>
          <Swiper.Item>
            <img src="https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fc-ssl.duitang.com%2Fuploads%2Fitem%2F201810%2F09%2F20181009134546_jXWjy.thumb.700_0.jpeg&refer=http%3A%2F%2Fc-ssl.duitang.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1675752015&t=36bf3037ef9b479f272eeba785567f96" />
          </Swiper.Item>
          <Swiper.Item>
            <img src="https://safe-img.xhscdn.com/bw1/9ec4b5a1-ed83-4f27-a13e-b3b2f7317e59?imageView2/2/w/1080/format/jpg" />
          </Swiper.Item>
        </Swiper>
        <div className='startBottom'>
          <Button color='warning' onClick={
            () => {
              navigate('/reg')
              navigate(0)
            }
          }>注册</Button>
          <Button color='primary' onClick={
            () => {
              navigate('/login', { state: { path } },)
              navigate(0)
            }
          }>登录</Button>
        </div>

      </div>
    </>
  )
}
